#pragma once

namespace net_tools{
class Eventloop;
namespace net{
class Connect;
}
}
#define USING_FAST_FUNCTION 1
#if USING_FAST_FUNCTION
  #include "base/function_my.hpp"

  using func = net_tools::base::Function<void()>;
  using connect_func = net_tools::base::Function<void(net_tools::net::Connect*)>;
  using eventloop_func = net_tools::base::Function<void(net_tools::Eventloop*)>;
  using message_func = net_tools::base::Function<unsigned int(net_tools::net::Connect*,char*,unsigned int)>;
  using rpc_callback = net_tools::base::Function<void(net_tools::net::Connect*,void*,unsigned int)>;

  extern template class net_tools::base::Function<void()>;
  extern template class net_tools::base::Function<void(net_tools::net::Connect*)>;
  extern template class net_tools::base::Function<void(net_tools::Eventloop*)>;
  extern template class net_tools::base::Function<unsigned int(net_tools::net::Connect*,char*,unsigned int)>;
  extern template class net_tools::base::Function<void(net_tools::net::Connect*,void*,unsigned int)>;

#else
  #include <functional>
  using func = std::function<void()>;
  using connect_func = std::function<void(net_tools::net::Connect*)>;
  using eventloop_func = std::function<void(net_tools::Eventloop*)>;
  using message_func = std::function<unsigned int(net_tools::net::Connect*,char*,unsigned int)>;
  using rpc_callback = std::function<void(net_tools::net::Connect*,void*,unsigned int)>;
#endif